home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 October / CHIP Turkiye Ekim 2000.iso / prog / naps / 04 / setup.exe / Gnucleus / GNU_Lang / GNU_Lang.cpp < prev    next >
C/C++ Source or Header  |  2000-06-24  |  2KB  |  52 lines

  1. // GNU_Lang.cpp : Defines the initialization routines for the DLL.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <afxdllx.h>
  6.  
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12.  
  13.  
  14. static AFX_EXTENSION_MODULE GNU_LangDLL = { NULL, NULL };
  15.  
  16. extern "C" int APIENTRY
  17. DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
  18. {
  19.     // Remove this if you use lpReserved
  20.     UNREFERENCED_PARAMETER(lpReserved);
  21.  
  22.     if (dwReason == DLL_PROCESS_ATTACH)
  23.     {
  24.         TRACE0("GNU_LANG.DLL Initializing!\n");
  25.         
  26.         // Extension DLL one-time initialization
  27.         if (!AfxInitExtensionModule(GNU_LangDLL, hInstance))
  28.             return 0;
  29.  
  30.         // Insert this DLL into the resource chain
  31.         // NOTE: If this Extension DLL is being implicitly linked to by
  32.         //  an MFC Regular DLL (such as an ActiveX Control)
  33.         //  instead of an MFC application, then you will want to
  34.         //  remove this line from DllMain and put it in a separate
  35.         //  function exported from this Extension DLL.  The Regular DLL
  36.         //  that uses this Extension DLL should then explicitly call that
  37.         //  function to initialize this Extension DLL.  Otherwise,
  38.         //  the CDynLinkLibrary object will not be attached to the
  39.         //  Regular DLL's resource chain, and serious problems will
  40.         //  result.
  41.  
  42.         new CDynLinkLibrary(GNU_LangDLL);
  43.     }
  44.     else if (dwReason == DLL_PROCESS_DETACH)
  45.     {
  46.         TRACE0("GNU_LANG.DLL Terminating!\n");
  47.         // Terminate the library before destructors are called
  48.         AfxTermExtensionModule(GNU_LangDLL);
  49.     }
  50.     return 1;   // ok
  51. }
  52.